<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@taglib uri="/struts-tags" prefix="s"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OA协同办公系统</title>
<link type="text/css" rel="stylesheet" href="css/table.css">
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/openwindow.js"></script>
<script type="text/javascript" src="js/file.js"></script>
<script type="text/javascript" src="js/flow.js"></script>
<script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<style type="text/css">
		body,td,th {
			font-family: "宋体";
			font-size: 12px;
		}
		.sendtd{border-bottom:#F00 double 1px}
		td{ color:#F00}
		.ztable{margin:15px 0 15px 0}
		</style>
	<script type="text/javascript">
		
	function nextstep(id,user){
		var flag=validateSend();
		if(!flag){
			return;
		}
		var table=$("#filetable").find("input[type=\"checkbox\"]");
		var fileId="";
		
		for(var i=0;i<table.length;i++){
			fileId+="_"+table[i].value;
		}
		$("#fileArray").val(fileId);
		var url="passDraft.action?nodeId="+id+"&executors="+user;
		enableFields(document.getElementsByTagName("input"));
    	enableFields(document.getElementsByTagName("textarea"));
    	enableFields(document.getElementsByTagName("select"));
		$.post(url,$("form").serialize(),function(data){
			if(data=="success"){
				alert("操作成功");
				window.close();
				var currentPage=$("#currentPage").val();
				window.opener.page(currentPage);
			}else{
				alert("操作失败");
			}
		});
	}
	function saveText(val,tem){
		$("#contentid").val(val);
		$("#templateId").val(tem);
	}
	
	function update(){
		var url="updateDraft.action";
		$.post(url,$("form").serialize(),function(data){
			if(data=="success"){
				alert("操作成功");
				window.close();
				var currentPage=$("#currentPage").val();
				window.opener.page(currentPage);
			}else{
				alert("操作失败");
			}
		});
	}
	function submitNextNode(id,actorType){
	if(actorType=='2'){
		getcandidateS(id);
	}else if(actorType=='3'){
		getorguserS(id);
	}else if(actorType=='5'){
		selectUserS(id);
	}else{
		nextstep(id,'');
	}
}	
	
function setValue(value,id){
	nextstep(id,value);
}
function supervision(){
	$("#supervisionTag").val("1");
	alert("成功督办！");
	var user=$("#user").val();
	$("#info").html("由"+user+"督办");
}
	
	function addSubject(){
	var url="addSubjectOut.action";
	openWindow(url,500,500);
}

function subjectAddouts(val){
	$("#ztc").val(val)
}
</script>
  </head>
  
<body onload="download()">
<input type="hidden" id="currentPage" value="${currentPage}">
<form action="" method="post" name="documentForm" >
<div id="nodebutton" style="margin-left: 100px">
	<input type="button" class="button_04" onclick="supervision()" value="督办">
	<input type='button' class='button_04' onclick="submitNextNode('${flowNode.id}','${flowNode.actorType}')" value='${flowNode.name}'/>&nbsp;
		<input type="checkbox" value="1" name="message">短信提醒
	<input style="float: right;margin-left: 20px" class="button_04"   type="reset" value="重置" />
	<input style="float: right;" class="button_04"   type="button" onclick="update();"  value="保存" />&nbsp;
</div>
<h1 align="center"style="color:#F00; font-weight:bold">${document.flowName}</h1>
<hr size="2" width="750px" color="#FF0000" />
<form action="" method="post" name="documentForm" >
<input type="hidden" name="document.fileArray" id="fileArray" value="${document.fileArray}">
<input type="hidden" name="document.id" value="${document.id}">
<input type="hidden" name="document.draftUser" value="${document.draftUser}">
<input type="hidden" name="document.draftStaus" value="${document.draftStaus}">
<input type="hidden" name="document.flowId" value="${document.flowId}">
<input type="hidden" name="document.sfstatus" value="${document.sfstatus}">
<input type="hidden" id="contentid" name="document.contentId" value="${document.contentId}">
<input type="hidden" name="document.processId" value="${document.processId}" >
<input type="hidden" name="propertyIds" value="${propertyIds}" id="propertyIds"/>
<input type="hidden" value="${mustPropertyIds}" id="mustPropertyIds"/>
<input type="hidden" id="templateId" name="document.template" value="${document.template}">
<table align="center" width="750px" border="0">
  <tr>
    <td class="sendtd">
    <table class="ztable" width="100%" border="0" cellpadding="0" cellspacing="0">
         <tr>
            <td height="30" colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;<input class="button_04" id="zwbj" disabled="disabled" type="button"  value="正文编辑" onclick="draftWord('2');" /></td>
          </tr>
          <tr>
            <td height="30" colspan="2">附件：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="button_04" type="button"  id="fjsc" disabled="disabled" value="上传附件" onclick="file_upload('filetable')" />
             <input type="button" class="button_02"  onclick="fileDel('filetable')"  value="删除"/>
            <table id="filetable">
			</table>
            </td>
          </tr>
          <tr>
            <td width="10%" height="80" valign="middle"> 
            附件表述：
            </td>
            <td width="90%" valign="middle"><textarea id="fjbs" disabled="disabled" name="document.fjbs" cols="50" rows="4"  >${document.fjbs}</textarea></td>
          </tr>
    	</table>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
  <table  class="ztable" width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="60%" >文头：<s:select id="wt" onchange="topChange(this.value)" list="topList" listKey="name" listValue="name" headerKey="" headerValue="" name="document.top" value="document.top"  disabled="true" cssStyle="width:200px;" theme="simple"></s:select></td>
            <td>发文字号：&nbsp;<span id="fwzh" disabled="disabled">
			 <input  id="postFont1" disabled="disabled"  type="text" name="document.postFont1" value="${document.postFont1}"  style="width:75px;" maxlength="20"/>
        <s:select id="postFont2"   disabled="true"  onchange="topChangeDate(this.value)"  list="#{'[2007]':'2007','[2008]':'2008','[2009]':'2009','[2010]':'2010','[2011]':'2011','[2012]':'2012','[2013]':'2013','[2014]':'2014','[2015]':'2015','[2016]':'2016','[2017]':'2017','[2018]':'2018','[2019]':'2019','[2020]':'2020'}" name="document.postFont2" headerKey="" headerValue="" value="document.postFont2" theme="simple"></s:select>
        <input  id="postFont3"  disabled="disabled" type="text" name="document.postFont3" value="${document.postFont3}"  style="width:50px;" maxlength="20"/>
				</span><font color="#000000">号</font></td>
          </tr>
        </table>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
  <table  class="ztable" width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="60%" >缓急程度：<s:select id="hjcd" disabled="disabled" list="#{'紧急':'紧急','加急':'加急','特提':'特提'}" headerKey="" name="document.hjStatu" value="document.hjStatu" headerValue="" theme="simple"></s:select></td>
            <td>印发日期：&nbsp;<input id="yfrq" name="document.printTime" onclick="WdatePicker({dateFmt:'%y年%M月%d日'})" value="${document.printTime}"  class="Wdate" style="width:130px"   disabled="disabled"/></td>
          </tr>
        </table>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ztable">
      	<tr>
            <td>发文标题：</td>
        		<td><textarea id="fwbt" cols="60" rows="4" name="document.title"  disabled="disabled">${document.title }</textarea>&nbsp;<font style=" font-weight:bold">*</font></td>
          </tr>    
    </table>
	</td>
  </tr>
  <tr>
    <td class="sendtd">
    	<div class="ztable">
    		主题词：&nbsp;
            <input onclick="addSubject()" id="ztc" value="${document.them}" name="document.them" disabled="disabled" style=" width:500px;background:none;border-bottom:#999 double 1px; border-left:none; border-right:none; border-top:none" />
      </div>
	</td>
  </tr>
  <tr>
    <td class="sendtd"><table class="ztable" width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="10%" height="20" >主送：</td>
        <td>
        	<input id="zs" value="${document.sendFrom}" name="document.sendFrom" disabled="disabled" style=" width:500px;background:none;border-bottom:#999 double 1px; border-left:none; border-right:none; border-top:none" />
        </td>
      </tr>
      <tr>
        <td height="20">抄送：</td>
        <td>
        	<input id="cs"  name="document.writeFrom" value="${document.writeFrom }" disabled="disabled" style=" width:500px;background:none;border-bottom:#999 double 1px; border-left:none; border-right:none; border-top:none" />
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="sendtd">
    	<div class="ztable">拟文单位：&nbsp;
        	<input id="nwdw" value="${document.draftOrg }" name="document.draftOrg" disabled="disabled" style=" width:350px;background:none;border-bottom:#999 double 1px; border-left:none; border-right:none; border-top:none" />
        </div>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
    	<div class="ztable">拟稿人：&nbsp;
        	<input id="ngr" value="${document.draftName}" name="document.draftName" disabled="disabled" style=" width:350px;background:none;border-bottom:#999 double 1px; border-left:none; border-right:none; border-top:none" />
        </div>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
    	<div class="ztable">
    	<table><tr><td width="100px">承办单位意见：</td>
    		<td>${document.orgSugesstion}</td></tr>
    		</table> 
    		<textarea disabled="disabled" id="cbdwyj" onclick="OpenComment('cbdwyj')" style=" width:500px; height:10px; border:0; overflow:hidden" name="document.orgSugesstion"></textarea>
        </div>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
    	<div class="ztable">
    	<table><tr><td width="100px">会签：</td>
    		<td>${document.counterSign}</td></tr>
    		</table> 
    		<textarea disabled="disabled" id="hq" onclick="OpenComment('hq')" style=" width:500px; height:10px; border:0; overflow:hidden" name="document.counterSign"></textarea>
        </div>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
        <div class="ztable">
        <table><tr><td width="100px">核稿：</td>
    		<td>${document.checkDraft}</td></tr>
    		</table> 
       		<textarea disabled="disabled" id="hg" onclick="OpenComment('hg')" style=" width:500px; height:10px; border:0; overflow:hidden" name="document.checkDraft"></textarea>
        </div>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
    	 <div class="ztable">
    	 <table><tr><td width="100px"> 审阅意见：</td>
    		<td>${document.syyj}</td></tr>
    		</table>
       		<textarea disabled="disabled" id="syyj" onclick="OpenComment('syyj')"  style=" width:500px; height:10px; border:0; overflow:hidden" name="document.syyj"></textarea>
      	 </div>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
    	<div class="ztable">
    	<table><tr><td width="100px">审核意见：</td>
    		<td>${document.shyj}</td></tr>
    		</table>
  	       		<textarea disabled="disabled" id="shyj" onclick="OpenComment('shyj')"  style=" width:500px; height:10px; border:0; overflow:hidden" name="document.shyj"></textarea>
		</div>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
    	<div class="ztable">
    	<table><tr><td width="100px">签发：</td>
    		<td>${document.signOff}</td></tr>
    		</table>
  	       		<textarea disabled="disabled" id="qf" onclick="OpenComment('qf')"  style=" width:500px; height:10px; border:0; overflow:hidden" name="document.signOff"></textarea>
	  </div>
    </td>
  </tr>
  <tr>
    <td class="sendtd">
    	<div class="ztable">共印：
        	<input type="text" value="${document.print}" id="gy" name="document.print" disabled="disabled" style="width:45px; height:15px; background:none; text-align:center" />&nbsp;份
        </div>
    </td>
  </tr>
</table>
<table align="center" width="750px">
	<input type="hidden" id="user" value="${sessionScope.userInfo.name }">
	<input id="supervisionTag" type="hidden" name="supervisionTag">
	<input type="hidden" name="document.supervision" value="${document.supervision }">
	<tr><td id="info" style="color: red;">${document.supervision }</td></tr>
</table>
<div  align="center">
	<input type='button' class='button_04' onclick="submitNextNode('${flowNode.id}','${flowNode.actorType}')" value='${flowNode.name}'/>&nbsp;
		<input type="checkbox" value="1" name="message">短信提醒
</div>
</form>
</body>
</html>
